package com.corewillsoft.fireflies.gameobjects.obstacles;

import java.util.Arrays;
import java.util.List;

import com.corewillsoft.fireflies.gamelaws.LawType;
import com.corewillsoft.fireflies.gameobjects.fireflyraces.Color;

public class Fan extends Obstacle {
	/**
	 * Default height of the fan
	 */
	private static final float FAN_HEIGHT = 70f;

	/**
	 * Default width of the fan
	 */
	private static final float FAN_WIDTH = 25f;

	/**
	 * Default color of the fan
	 */
	private static final Color FAN_COLOR = new Color(0.9f, 0.9f, 0.4f);

	/**
	 * Aperture of fan (height of influence region);
	 * by default it is equal to height of fan
	 */
	private float aperture = FAN_HEIGHT;

	private final static List<LawType> supportedLaws = Arrays.asList();
	private final static List<LawType> createdLaws = Arrays
			.asList(LawType.FAN_FIREFLY,
					LawType.WALL_FIREFLY);

	public Fan() {
		super();
		init();
	}

	public Fan(int x, int y) {
		super(x, y);
		init();
	}

	private void init() {
		setWidth(FAN_WIDTH);
		setHeight(FAN_HEIGHT);
		setColor(FAN_COLOR.getRed(), FAN_COLOR.getGreen(), FAN_COLOR.getBlue());
	}

	public float getAperture() {
		return aperture;
	}

	public void setAperture(float aperture) {
		this.aperture = aperture;
	}

	/**
	 * Updates the state of the obstacle;
	 * As far as the parameters of fan don't change during the game, this method is empty
	 */
	@Override
	public void updateState() {
	}

	@Override
	public ObstacleType getType() {
		return ObstacleType.FAN;
	}

	@Override
	public boolean isActive() {
		return true;
	}

	@Override
	protected List<LawType> getSupportedLaws() {
		return supportedLaws;
	}

	@Override
	protected List<LawType> getCreatedLaws() {
		return createdLaws;
	}
}
